package com.xinchao.ck_mips.model;

import com.xinchao.ck_mips.http.CKRequestSubscriber;
import com.xinchao.ck_mips.http.CKResponse;
import com.xinchao.ck_mips.http.api.ApiService;
import com.xinchao.ck_mips.http.client.RetrofitClient;
import com.xinchao.ck_mips.utils.RequestUtils;

import io.reactivex.Flowable;

/**
 * Created by wq on 2019/4/26.
 */
public interface BaseModel {
    default ApiService getService() {
        return RetrofitClient.getInstance().getApiService();
    }

    default <T> void request(Flowable<CKResponse<T>> flowable, CKRequestSubscriber<T> listener) {
        RequestUtils.request(flowable, listener);
    }

    default <T> void requestIoThread(Flowable<CKResponse<T>> flowable, CKRequestSubscriber<T> listener) {
        RequestUtils.requestIoThread(flowable, listener);
    }

}
